package com.example.springworkadmin.dao;

import com.example.springworkadmin.entity.ResidentStatus;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository

public interface ResidentStatusDao {

    @Select("select count(*) from healthy_status join household USING (account) where account=#{id} and date >= #{startTime} and date <= #{endTime}")
    Integer count(@Param("id")String id,@Param("startTime") String startTime, @Param("endTime") String endTime);

    @Select("select * from healthy_status join household USING (account) where account=#{id} and date >= #{startTime} and date <= #{endTime} order by date desc")
    List<ResidentStatus> get(@Param("id")String id,@Param("startTime") String startTime, @Param("endTime") String endTime);
}
